home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / utility / horst_2.zip / LOGTRIM.DOC < prev    next >
Text File  |  1995-12-18  |  3KB  |  85 lines

  1. ------------------------------------------------------------------------
  2. LOGTRIM   trim logfiles                 Ver 1.4 (c) 1995 Horst Schaeffer
  3. ------------------------------------------------------------------------
  4.  
  5. LOGTRIM keeps the size of logfiles within a given range (kilobytes).
  6. Files are always cut at the beginning of a line. The optional string
  7. is used to identify the beginning of a log section for proper cutting.
  8.  
  9. Syntax:    LOGTRIM logfile minKB maxKB ["string"]
  10.            --------------------------------------
  11. Example:   LOGTRIM fd.log  200 160 "--------"
  12.  
  13. ---------- Parameters:
  14.  
  15. logfile:   Name of file to trim (drive, path optional).
  16.            First character of filespec must not be "@" (see below).
  17.            File size not limited.
  18.  
  19. maxKB:     There will be no action if the file size is not beyond maxKB.
  20.            If file size > maxKB, then:
  21. minKB:     the file will be reduced to minKB
  22.            (cut at beginning of next line)
  23.  
  24.            The two values may be specified in any order.
  25.            If only one value is specified, this will refer to maxKB,
  26.            and minKB defaults to half the value of maxKB.
  27.            Comma separators allowed.
  28.  
  29. string:    (optional, single or double quotes)
  30.            LOGTRIM will search for the first occurrence of this string
  31.            (from the break point determined by minKB) and cut at the
  32.            beginning of that line.
  33.  
  34.            If the string cannot be found within the first 10%
  35.            of the remaining file, the string option is ignored.
  36.  
  37.            Special feature: an empty string ("") will cause LOGTRIM
  38.            to look for an empty line.
  39.  
  40. output:    LOGTRIM confirms the filename and indicates "trimmed"
  41.            if any action was taken.
  42.  
  43. note:      No action if logfile is opened by other task (error msg).
  44.  
  45. In case of write or rename errors the temporary file LOG$$$$$.TMP may
  46. remain in the current directory. Before deleting this file make sure
  47. that the original log file still exists.
  48.  
  49. Errorlevel: 0      no action or successful completion
  50.             else:  error (message)
  51.  
  52.  
  53. ---------- Reading parameters from a control file
  54.  
  55. For multiple logfile handling LOGTRIM can read the parameters from
  56. a control file holding the command arguments for each file to trim
  57. (line by line), e.g.:
  58.  
  59.            C:\LOG 30 20 'on'
  60.            C:\FD\FD.LOG 200 160 "--------"
  61.            C:\FD\FDTRANX.LOG 10,6,"────"
  62.  
  63. A control file will be used by the following syntax:
  64.  
  65.            LOGTRIM @ control_file
  66.            ----------------------
  67. Drive and path for control_file are optional. A space between @-sign and
  68. filespec is not required. Examples:
  69.  
  70.            LOGTRIM @loglist
  71.            LOGTRIM @ C:\util\logfiles.lst
  72.  
  73. In the control file any lines starting with a semicolon (;) and empty
  74. lines are ignored. If an asterisk (*) is found at the beginning of a
  75. line, the rest of the file will be ignored. The size is limited to 4 KB.
  76.  
  77. In case of read errors in one of the log files, LOGTRIM proceeds with
  78. the next line in the control file, but LOGTRIM will abort on write/make/
  79. rename errors to avoid loss of data.
  80.  
  81. = 02 APR 1995 - Horst Schaeffer, FIDO 2:2480/13.75
  82.                 Internet: horst_schaeffer@confusion.muc.nacamar.de
  83.  
  84. = Thanks to Bat Lang for his contribution to the concept of LOGTRIM. =
  85.